<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ include file="../common.inc" %>  
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link href="./css/style1.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="./js/form.js"></script>
<script type="text/javascript" language="javascript">
<!--
	function pageCustomer(flag){
		document.newsNoticeForm.action = "./manageReport.do?action=saleStatisticContract&flag="+flag;
		document.newsNoticeForm.target = "main";
		document.newsNoticeForm.submit();
	}
	
	function back(){
		window.location.href = "./manageReport.do";
		window.location.target = "main";
	}
	function aaa(aaa){
		window.location.href = aaa;
		window.location.target = "main";
		}
-->
</script>
</head>
<body>
<form name="newsNoticeForm" action="" method="post">
<table class="table_frame">
		<tr>
			<td>
				<table class="table_title2">
					<tr>
						<td>
							<table cellpadding="0" cellspacing="0" width="100%" height="100%">
								<tr>
									<td class="title_lab">分析报表</td>
									<td align="left">&nbsp;&nbsp;快速查看：
									<select onchange="aaa(this.options[this.selectedIndex].value);">
									<option>-------------请选择-------------</option>
									<option value="./manageReport.do?action=preSalePeriodReport">销售周期分析表</option>
									<option value="./manageReport.do?action=saleMonthReport">销售月度统计表</option>
									<option value="./manageReport.do?action=allCustomerDevoteAnalysis">客户贡献统计表</option>
									<option value="./manageReport.do?action=oldCustomerDevoteAnalysis">老客户贡献分析表</option>
									<option value="./manageReport.do?action=marketExpandsAnalysis">市场开拓同步分析表</option>
									<option value="./manageReport.do?action=annualWreathCompares">年度环比分析表</option>
									<option value="./manageReport.do?action=getLinkManMailInfo">联系人邮件列表</option>
									<option value="./manageReport.do?action=CustomerStatisticContract">按客户统计合同</option>
									<option value="./manageReport.do?action=saleStatisticContract">按销售统计合同</option>
									
									</select>
									</td>
								</tr>
							</table>
						</td>
					</tr>
					<tr><td style="height: 55px;text-align: center;font-weight: bold;font-size: 24px;">按销售统计合同报表</td></tr>
					<tr>
						<td align="center">
							<table class="table_report1" cellpadding="0" cellspacing="0" height="100%" style="width: 95%;">
								<tr>
									<td align="center" height="30">
										<input class="btn_report" type="button" value="" onclick="createReport()"/>&nbsp;&nbsp;
										<button class="btn_back" onclick="back()" hidefocus="true">返回</button>
									</td>
								</tr>
							</table>
						</td>
					</tr>
					<tr>
						<td align="center">
							<table class="table_sreport" style="width: 95%;">
								<tr>
									<td class="title">销售代表</td>	
									<td class="title">合同编号</td>	
									<td class="title">签约日期</td>	
									<td class="title">合同金额</td>	
									<td class="title">回款金额</td>	
									<td class="title">应收账款</td>
									<td class="title">开票金额</td>		
								</tr>
								<c:forEach items="${report}" var="item">
								<tr onmouseover="onmousemoveChange(this,'img${item.id}')" onmouseout="onmouseoutChange(this,'img${item.id}')">
									<td>${item.salePerson }</td>
									<td><a href="./contract.do?action=contractDetail&sign=290&id=${item.id }" target="main">${item.contractCode }</a></td>
									<td><fmt:formatDate value="${item.contractDate}" pattern="yyyy-MM-dd"/></td>
									<td>￥<fmt:formatNumber value="${item.contractCost }" pattern="###,###,###,###.##"/></td>
									<td>￥<fmt:formatNumber value="${item.backCost }" pattern="###,###,###,###.##"/></td>
									<td>￥<fmt:formatNumber value="${item.receivable }" pattern="###,###,###,###.##"/></td>
									<td>￥
									<c:choose>
									<c:when test="${item.invoiceCost != null}">
									<fmt:formatNumber value="${item.invoiceCost }" pattern="###,###,###,###.##"/>
									</c:when>
									<c:otherwise>
									0
									</c:otherwise>
									</c:choose>
									</td>
								</tr>
								</c:forEach>
							</table>
						</td>
					</tr>
					<tr>
						<td align="center">
							<table class="table_page" style="width: 95%;text-align: left;">
								<tr>
									<td>&nbsp;&nbsp;
										<img src="./images/frist.bmp" onclick="pageCustomer(1)" alt="首页" style="vertical-align: middle;cursor: hand;">
										<img src="./images/last.bmp" onclick="pageCustomer(2)" alt="上一页" style="vertical-align: middle;cursor: hand;">&nbsp;
										<font color="red">${currentPage}</font>/${totalPages}&nbsp;<fmt:message key='common.page'/>&nbsp;
										<img src="./images/next.bmp" onclick="pageCustomer(3)" alt="下一页" style="vertical-align: middle;cursor: hand;">
										<img src="./images/end.bmp" onclick="pageCustomer(4)" alt="末页" style="vertical-align: middle;cursor: hand;">
										共&nbsp;&nbsp;${totalRows}&nbsp;<fmt:message key='common.page.totalRow'/>
									</td>
								</tr>
							</table>
						</td>
					</tr>
				</table>
			</td>
		</tr>
	</table>
	</form>
</body>
</html>